package com.winning.pmph.vo;

import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import org.apache.commons.collections.CollectionUtils;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author admin
 */
@Data
public class IncreaseBookVo implements Serializable {

    private static final long serialVersionUID = 2701348414896976307L;

    private String bookId;
    private String bookName;
    private String topicNumber;
    private String isbn;
    private String mainEditor;
    private String deputyEditor;
    private String indexImg;
    private String summary;
    private JSONArray category;
    private Integer hidden;
    private Integer sourcePubType;

    public Integer getHidden() {
        return Objects.nonNull(hidden) ? hidden : 1;
    }

    public Integer getSourcePubType() {
        return Objects.nonNull(sourcePubType) ? sourcePubType : 1;
    }

    public JSONArray getCategory() {
        return CollectionUtils.isEmpty(category) ? new JSONArray() : category;
    }
}
